package com.komorebishao.basic;

public class TestInnerClass {
    private int number = 100;
    public class Inner {
        private int number = 200;
        public void paint() {
            int number = 500;
            //局部覆盖  打印的为500
            System.out.println("number = " + number);
            //this.number引用的是内部类的成员属性 打印的为200
            System.out.println("this.number = " + this.number);
            System.out.println("TestInnerClass.this.number = " + TestInnerClass.this.number);
        }
    }

    public static void main(String[] args) {
        TestInnerClass testInnerClass = new TestInnerClass();
        TestInnerClass.Inner inner = testInnerClass.new Inner();
        inner.paint();
    }
}
